1. Field of the Invention
The present invention relates to a transcoding method, and more particularly, to a transcoding apparatus and method between two codecs each including a deblocking filter.
2. Description of the Related Art
‘Video transcoding’ is converting data compressed according to a certain video codec into compression data of another video codec or into a different type of compression data of the same video codec. Video transcoding is required when a user device such as a terminal device supports only a certain video codec, when an amount or speed of data to be transmitted has to be controlled according to, for example, a condition of a network, or when users request various services such as a high-quality video content service or a high speed service.
An example of video transcoding between different types of video codes is converting data between a Moving Picture Experts Group-4 (MPEG-4) codec and an H.264/Advanced Video Coding (AVC) codec. An example of video transcoding between the same types of video codes is converting a profile in an H.264/AVC codec. For example, a baseline profile is converted into an upper profile, or vice versa. Another example of video transcoding between the same types of video codes is controlling data capacity or video quality from a service provider. For example, data encoded according to a baseline profile of an H.264/AVC is converted into data of the same baseline profile by reducing capacity of the data.
The most basic method from among a plurality of transcoding methods is decoding data encoded according to a certain codec, and then encoding the decoded data according to a desired codec. In this case, a transcoding apparatus can be formed by sequentially connecting a decoder corresponding to the encoded data and an encoder corresponding to the desired codec.
FIG. 1 is a diagram for describing a transcoding apparatus and method from an MPEG-4 codec (MPEG-4 part 2 visual codec) to an H.264/AVC codec. In FIG. 1, a decoding unit A of a transcoder corresponds to a decoder of the MPEG-4 codec and an encoding unit B of the transcoder corresponds to an encoder of the H.264/AVC codec.
Referring to FIG. 1, a bitstream of data encoded according to the MPEG-4 codec is input to the decoding unit A of the transcoder, which corresponds to the decoder of the MPEG-4 codec. If the input bitstream is an intra block, the decoding unit A sequentially performs entropy decoding, inverse quantization, and inverse transformation so as to generate a decoded image. If the input bitstream is an inter block, the decoding unit A adds a prediction image generated by further performing motion compensation to a residual data generated by further performing inverse transformation, so as to generate the decoded image. Then, the decoded image is stored in a reference image buffer for next prediction and also is temporarily stored in an image buffer before being input to the encoding unit B of the transcoder.
Then, the decoded image stored in the image buffer is input to the encoding unit B of the transcoder, which corresponds to the encoder of the H.264/AVC codec. The encoding unit B initially generates a prediction image. If input data corresponds to an intra block, the encoding unit B generates the prediction image by performing intra prediction. On the other hand, if the input data corresponds to an inter block, the encoding unit B generates the prediction image by generating a motion vector through motion estimation from a reference image stored in the reference image buffer, and performing motion compensation based on the motion vector. The prediction image is subtracted from the input image so as to obtain a residual data, and output data corresponding to the H.264/AVC codec (H.264/AVC bitstream) is generated by performing transformation, quantization, and entropy coding on the residual data. Also, a reconstructed residual image is generated by performing inverse quantization and inverse transformation after quantization is performed, deblocking filtering is performed on an image generated by adding the reconstructed residual image to the prediction image through a deblocking filter, and an image generated by performing deblocking filtering is stored in the reference image buffer for next reference.
The transcoding method illustrated in FIG. 1 includes both a decoding process and an encoding process. Thus, a transcoding process is complicated and a transcoding speed is slower than other transcoding methods. However, in the transcoding method illustrated in FIG. 1, data loss during the transcoding process is minimized and thus the performance is excellent. In particular, if information such as motion information or block type information of original data before being transcoded is used when the data is encoded, complexity of transcoding can be reduced and speed can be improved.